package com.compass.doctor.ui.home.viewmodel

import androidx.lifecycle.MutableLiveData
import com.compass.framework.ext.toJson
import com.compass.framework.model.Dictionaries
import com.compass.framework.model.DoctorUrgency
import com.compass.framework.model.TodayNumber
import com.compass.framework.toast.TipsToast
import com.compass.framework.utils.LogUtil
import com.compass.network.callback.IApiErrorCallback
import com.compass.network.manager.ApiManager
import com.compass.network.viewmodel.BaseViewModel

/**
 * Description： homeViewModel
 * Date:2023/11/9 14:05
 */
class HomeViewModel : BaseViewModel() {

     val doctorUrgencyLiveData = MutableLiveData<MutableList<DoctorUrgency>?>()

    //紧急代办
    fun getDoctorUrgency(typeValue :String){
        launchUIWithResult(responseBlock = {
            ApiManager.api.doctorUrgency(typeValue)
        }, errorCall = object : IApiErrorCallback {
            override fun onError(code: Int?, error: String?) {
                doctorUrgencyLiveData.value=null
                LogUtil.e("list==onError")
            }
        }, successBlock = {

            doctorUrgencyLiveData.value=it
        })
    }

}